<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script>
</head>
<body>
<form action="">
    <p>
        用户名:<input type="text" name="uname">
    </p>
    <p>
        密码:<input type="text" name="upwd">
    </p>
    <p>
        姓名:<input type="text" name="realname">
    </p>
    <p>
        年龄:<input type="number" name="uage">
    </p>
    <p>
        手机号:<input type="tel" name="uphone">
    </p>
    <button>注册</button>
</form>
    <script>
        document.forms[0].onsubmit=function(){
            var oUser={
                uname:this.uname.value,
                upwd:this.upwd.value,
                realname:this.realname.value,
                uage:this.uage.value,
                uphone:this.uphone.value
            }

            axios.post("http://useker.cn/reg",oUser).then(function(res){
                let {data}=res;
                console.log(res);
            })
            return false;
        }
    </script>
</body>
</html>